using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using BSCMFF.Core.MembershipDataProvider;
using BSCMFF.Core.DataAccessLayer;
using System.Collections;
using Telerik.Web.UI;
using System.Web.UI;
using System.Globalization;
using System.Threading;

public partial class Default : Page
{
    

    protected void Page_Load(object sender, EventArgs e)
    {
        CultureInfo info2 = System.Threading.Thread.CurrentThread.CurrentUICulture;

        //System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("sk-SK");
        jazyk.Text += "<br /> + CultureUI name:" + info2.Name;
        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("sk-SK");

        CultureInfo info = System.Threading.Thread.CurrentThread.CurrentCulture;
        info2 = System.Threading.Thread.CurrentThread.CurrentUICulture;

        jazyk.Text += "<br /> + CultureUI name:" + info2.Name;

        //"Culture parent name: " + info.Parent.Name + "<br />" +

        //"Display name: " + info.Parent.DisplayName + "<br />" +

        //"English name: " + info.EnglishName + "<br />" +

        //"Native name: " + info.NativeName + "<br />" +

        //"ISO name: " + info.Parent.ThreeLetterISOLanguageName + "<br />" +

        //"Calendar type: " + info.Calendar.ToString();



        //jazyk.Text += "<hr />" + DateTime.Now.ToString();


        //LabelResult.Text = "page loadddd";
       // Click1(sender, new EventArgs());
        //LabelResult.Text += "page_load <br />";


        //BSCEntities context = new BSCEntities();
        //LabelResult.Text += "new bscentities <br />";
        

        //var roles = (from r in context.Roles
        //             select r).ToList();

        //LabelResult.Text += "po var <br />";

        //DropDownList1.DataSource = roles;

        //LabelResult.Text += "datasource <br />";

        //DropDownList1.DataBind();
        //LabelResult.Text += "data bind <br />";

        BSCEntities context = new BSCEntities();

        var ns = (from n in context.Strategy_Node
                     select n).ToList();

        
        nodes.DataSource = ns;
        nodes.DataValueField = "Strategy_Node_ID";
        nodes.DataTextField = "Strategy_Node_ID";
        nodes.DataBind();
    }


    protected void bjazyk_click(object sender, EventArgs e)
    {
        System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("sk-SK");

        System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("sk-SK");

        CultureInfo info = System.Threading.Thread.CurrentThread.CurrentCulture;

        jazyk.Text += "Culture nane: " + info.Name + "<br />" +

        "Culture parent name: " + info.Parent.Name + "<br />" +

        "Display name: " + info.Parent.DisplayName + "<br />" +

        "English name: " + info.EnglishName + "<br />" +

        "Native name: " + info.NativeName + "<br />" +

        "ISO name: " + info.Parent.ThreeLetterISOLanguageName + "<br />" +

        "Calendar type: " + info.Calendar.ToString();



        jazyk.Text += "<hr />" + DateTime.Now.ToString();
    }

    protected void Click1(object sender, EventArgs e)
    {
        LabelResult.Text += "page_load <br />";


        BSCEntities context = new BSCEntities();
        LabelResult.Text += "new bscentities <br />";


        var roles = (from r in context.Roles
                     select r).ToList();

        LabelResult.Text += "po var <br />";

        DropDownList1.DataSource = roles;

        LabelResult.Text += "datasource <br />";

        DropDownList1.DataBind();
        LabelResult.Text += "data bind <br />";

    }

    protected void Click2(object sender, EventArgs e)
    {
        LabelResult.Text += "tralala";


        //BSCEntities context = new BSCEntities();
        //LabelResult.Text += "new bscentities <br />";


        //var roles = (from r in context.Roles
        //             select r).ToList();

        //LabelResult.Text += "po var <br />";

        //DropDownList1.DataSource = roles;

        //LabelResult.Text += "datasource <br />";

        //DropDownList1.DataBind();
        //LabelResult.Text += "data bind <br />";

    }

    protected void bjazyk_Click1(object sender, EventArgs e)
    {
        //info.Text += "tralal";

        //System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("sk-SK");

        //System.Threading.Thread.CurrentThread.CurrentUICulture = new CultureInfo("sk-SK");

        CultureInfo info2 = System.Threading.Thread.CurrentThread.CurrentUICulture;

        UICulture = "sk-SK";
        Culture = "sk-SK"; ;

        Thread.CurrentThread.CurrentCulture =
            CultureInfo.CreateSpecificCulture("sk-SK");
        Thread.CurrentThread.CurrentUICulture = new
            CultureInfo("sk-SK");

        info.Text += "Culture nane: " + info2.Name;

        Response.Redirect(Request.Url.AbsolutePath);

    }

    //protected override void InitializeCulture()
    //{
    //        UICulture = "sk-SK";
    //        Culture = "sk-SK";;

    //        Thread.CurrentThread.CurrentCulture =
    //            CultureInfo.CreateSpecificCulture("sk-SK");
    //        Thread.CurrentThread.CurrentUICulture = new
    //            CultureInfo("sk-SK");
        
    //    base.InitializeCulture();
    //}
}
